<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $html->charset(); 
date_default_timezone_set('America/Lima');
?>
<title>UPSEP</title>
<?php 
	echo $html->css('themes/redmond/jquery-ui-1.7.1.custom.css');
	// css necesarios
	//echo $html->css('ui/jquery-ui-1.8.4.custom.css');
	echo $html->css('themes/redmond/jquery-ui-1.7.1.custom.css');
	//echo $html->css('asd/jquery-ui-1.8.17.custom.css');
	//echo $html->css('themes/ui-darkness/jquery-ui-1.7.3.custom.css');
	echo $html->css('themes/redmond/jquery.ui.autocomplete.css');
	
	echo $html->css('themes/ui.jqgrid.css');
	echo $html->css('themes/ui.multiselect.css');
	echo $html->css('blueprint.css');
	echo $html->css('general.css');
	
	//video css	
	//echo $html->css('js/video-js/video-js.css');
	
	// jQuery Framework
	echo $html->script('js/jquery-1.4.2.min.js');
	
	// jQuery UI - Dialogos, calendario, etc
	echo $html->script('js/ui/jquery-ui-1.8.4.custom.js');
	//echo $html->script('js/jquery-ui-1.7.2.custom.js');
	
	// uso de grid
	echo $html->script('js/jquery.layout.js');
	echo $html->script('js/i18n/grid.locale-sp.js');
	echo $html->script('js/jquery.jqGrid.min.js');
	
	// Archivos para - jQuery UI 
	echo $html->script('js/ui/jquery.ui.core.js');
	echo $html->script('js/ui/jquery.ui.draggable.js');
	echo $html->script('js/ui/jquery.ui.resizable.js');
	echo $html->script('js/ui/jquery.ui.dialog.js');
	echo $html->script('js/ui/jquery.ui.datepicker.js');
	echo $html->script('js/ui/jquery.ui.widget.js');
	echo $html->script('js/ui/jquery.ui.position.js');
	echo $html->script('js/ui/jquery.ui.tabs.js');
	echo $html->script('js/ui/jquery.ui.autocomplete.js');
	echo $html->script('js/ui/i18n/ui.datepicker-es.js');
	
	echo $html->script('js/validate/jquery.validate.min.js');
	echo $html->script('js/validate/messages_es.js');
	
	echo $html->script('asistencias/index.js');
 ?>
 
<script type="text/javascript">
$(function(){
	asistencias.init();	
	HoraActual(<?php echo date('H').', '.date('i').', '.date('s'); ?>);	
});
</script>
</head>
<body>
<div id='fecha'>
<?php

$dias = array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado");
$meses = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");

echo '<h1 class="ui-widget-header text_right">' . $dias[date('w')]." ".date('d')." de ".$meses[date('n')-1]. " del ".date('Y') . '</h2>';

?>


</div>
<table width="100%">
	<tr>
	<th>
		<div class="box ui-corner-all span-8">
		<?php echo $form->create('Asistencia',array('id'=>'asistenciasForm','url'=>array('controller'=>'asistencias','action'=>'index'))); ?>
		<table class="tablaFormHeader"><?php echo
			'<tr>'
				.'<td>&nbsp;&nbsp;&nbsp;&nbsp;'.$form->label('id', __('CODIGO', true)).' </td>'
				.'<td>'.$form->input('codigo', array('value'=>'','label'=>false,'div'=>false, 'size'=>'20', 'class'=>'text ui-widget-content ui-corner-all','readonly'=>false)).'&nbsp;</td>'
				.'<td class="text_right">'.$form->submit('marcar', array('id'=>'bt_buscar','div'=>false,'hidden' => true)).'</td>'
			.'</tr>'; ?>
		</table>
		<?php echo $form->end(); ?>						
		</div>
	</th>
	<th align="right" class="span-20"><FONT SIZE=15 ><div id="contenedor_reloj"></div></FONT></th>
	</tr>
	</table>
	
	<table width="100%">
	<tr>
	<th>
		<div id=datos >
				<table>
				<tr>
					<th class="box ui-corner-all span-9">DATOS	</th>
					<th class="box ui-corner-all span-7">FOTO</th>
				</tr>
				<tr>
					<td align="left">
						<table class="tablaForm tablaFormInput">
							<tr>
								<th class="header span-4 text_left">CODIGO</th>
								<th class="header text_left">:</th>
								<td class="span-9"><?php echo $persona[0]['Persona']['codigo']; ?></td>
							</tr>
							<tr>
								<th class="header text_left">APELLIDOS Y NOMBRES</th>
								<th class="header text_left">:</th>
								<td><?php echo $persona[0]['Persona']['nombre_completo']; ?></td>
							</tr>
							<tr>
								<th class="header text_left">FACULTAD</th>
								<th class="header text_left">:</th>
								<td>-</td>
							</tr>		
							<tr>
								<th class="header text_left">ESCUELA</th>
								<th class="header text_left">:</th>
								<td><?php echo $persona[0]['Persona']['grupo']; ?></td>
							</tr>	
							<tr>
								<th class="header text_left">TIPO</th>
								<th class="header text_left">:</th>
								<td><?php echo $persona[0]['Persona']['descripcion']; ?></td>
							</tr>
						</table>
					</td>
					<td>
						<?php echo $html->image('fotos/0000000000.jpg', array('title'=>__('ver',true))); ?>
					</td>
				<tr>
				</tr>
				</table>
		</div>
	</th>
	<th align="center"><IMG SRC="http://www.upsep.edu.pe/web/images/logo.jpg" BORDER=0></th>
	</tr>
	</table>
	<table height="50px">
	<tr>
		<td>
			<div id="asistencias_dia"  style="height: 300px; overflow-y: scroll;">	
				<table class="tablaForm tablaFormInput">
					<thead>
					<tr>
						<th class="header" ><div class="span-1">Codigo</div></th>
						<th class="header"><div class="span-5">Persona</div></th>
						<th class="header"><div class="span-3">Hora</div></th>
						<th class="header"><div class="span-1">Acción</div></th>
						<th class="header"><div class="span-3">Carrera</div></th>
						<th class="header"><div class="span-3">Tipo</div></th>
					</tr>	
					</thead>
					<tbody><?php
					foreach($asist as $asistencias):	
					echo
				 	'<tr class="ui-widget-content jqgrow ui-row-ltr">'
						.'<td class="text_center">'.$asistencias['Persona']['codigo'].'</td>'
						.'<td>'.$asistencias['Persona']['nombre_completo'].'</td>'						
						.'<td class="text_center">'.$asistencias['Asistencia']['hora'].'</td>';
						if ($asistencias['Asistencia']['asistio'])
						{
							echo '<td>' . $html->image('entra.png', array('title'=>__('ver',true), "alt" => "Evolution))Soft", 'onclick' => "http://evolutionsoftperu.com")) . '</td>';
						}
						else
						{
							echo '<td>' . $html->image('sale.png', array('title'=>__('ver',true), "alt" => "Evolution))Soft", 'onclick' => "http://evolutionsoftperu.com")) . '</td>';
						}
					
					echo '<td>'.$asistencias['Persona']['grupo'].'</td>'
						.'<td class="text_center">'. $tipopersona[$asistencias['Persona']['tipopersona_id']].'</td>'
					.'</tr>';
					endforeach;
					?></tbody>
				</table>
			</div>
		</td>
		<td valign="top">
			<div id="avisos">
				<table class="tablaForm tablaFormInput">
						<thead>
							<tr>
								<th class="header span-10">AVISO</th>
							</tr>
						</thead>
						<tbody>
						<tr class="ui-widget-content jqgrow ui-row-ltr">
							<td><IMG SRC="http://www.upsep.edu.pe/web/images/imagen17oct.jpg" width="580" height="270" BORDER=0></td>							
						</tr>						
						</tbody>
				</table>		
		 	</div>
		</td>
	
	</tr>
</table>
</body>
